home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / language / isetl.arc / median.t < prev    next >
Text File  |  1987-08-20  |  319b  |  19 lines

  1. program median;
  2.     while s /= [] do
  3.     print "Enter a set or tuple:";
  4.     read s;
  5.     x := arb({ x :  x in s |
  6.         #[y: y in s | y < x] = #[y: y in s | y > x] } );
  7.     if x /= om
  8.         then print ["Median of", s, "is", x];
  9.         else print [s, "has no median"];
  10.         end;
  11.     end;
  12.     end;
  13.  
  14.  
  15. [1..10];
  16. [1..11];
  17. [x**2: x in [1..11]];
  18. [];
  19.